package com.guyaogg.gulimall.search.vo;

import com.guyaogg.common.to.es.SkuEsModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

/**
 * @author 顾遥
 */
@Data
public class SearchResult {

    /**
     * 查询所有的商品信息
     */
    private List<SkuEsModel> products;

    /**
     * 以下是分页信息
     */
    private Integer pageNum;
    private Long total;
    private Integer totalPages;
    private List<Integer> pageNavs;

    /**
     * 当前查询到的结果所有涉及的品牌
     */
    private List<BrandVO> brands;
    /**
     * 当前查询到的结果所有涉及的所有属性
     */
    private List<AttrVO> attrs;
    private List<CatalogVO> catalogs;

    //===============以上是返回给页面的信息====================//

    /**
     * 面包屑导航信息
     */
    private List<NavVO> navs = new ArrayList<>();
    private List<Long> attrIds = new ArrayList<>();

    @Data
    public static class NavVO{
        private String navName;
        private String navValue;
        private String link;
    }

    /**
     * 品牌
     */
    @AllArgsConstructor
    @NoArgsConstructor
    @Data
    public static class BrandVO {
        private Long brandId;
        private String brandName;
        private String brandImg;
    }

    /**
     * 属性
     */
    @AllArgsConstructor
    @NoArgsConstructor
    @Data
    public static class AttrVO {
        private Long attrId;
        private String attrName;
        private List<String> attrValue;
    }
    /**
     * 分类
     */
    @Data
    public static class CatalogVO {
        private Long catalogId;
        private String catalogName;
    }
}
